package condition;

import be.kuleuven.cs.som.annotate.Basic;
import exceptions.IllegalConditionException;

/**
 * A class of unary composed conditions.
 *   A unary composed condition involves a single operator applied
 *   to one single condition.
 *  
 * @version	3.0
 * @author 	Lies Tambeur 	r0264469	2Bcwsbbh
 * @author	Eline Vanrykel	r0264543	2Bcwselt
 */
public abstract class UnaryComposedCondition extends ComposedCondition {

	protected Condition condition;
	
	/**
	 * Initialize this new unary composed condition with given conditions.
	 *
	 * @param 	condition
	 * 			The condition for this binary composed condition.
	 * @post   	The condition of this new binary composed condition is the
	 *         	same as the given condition.
	 * @throws 	IllegalConditionException
	 * 			This new binary composed condition cannot have
	 * 			the given condition.      
	 */
	protected UnaryComposedCondition(Condition condition) throws IllegalConditionException{
		if(!canHaveAsCondition(condition)){
			throw new IllegalConditionException();
		}
		this.condition = condition;

	}
	
	/**
	 * The condition of this unary composed condition.
	 */
	@Basic
	protected Condition getCondition(){
		return this.condition;
	}
}
